<!--* 菜单组件-->
<!--* @module src/components/module-->
<!--* @desc 菜单-->
<!--* @author chenyi-->
<!--* @date 2019年08月15日17:22:43-->
<!--* @param menuList - 菜单json-->

<template>
  <div class="nav-menus"   v-if="menuList.length>0">
    <label v-for="navMenu in menuList" >
      <el-menu-item  v-if="!navMenu.children" :key="navMenu.route"  :index="navMenu.route">
         <i :class="navMenu.icon"></i>
         <span slot="title">{{navMenu.name}}</span>
        </el-menu-item>
      <el-submenu v-if="navMenu.children"
      :key="navMenu.route" :data="navMenu" :index="navMenu.route">
       <template slot="title">
        <i :class="navMenu.icon"></i>
        <span> {{navMenu.name}}</span>
        </template>
       <nav-menus :menu-list="navMenu.children"></nav-menus>
       </el-submenu> </label>
  </div>
</template>

<script>
  export default {
    name: 'nav-menus',
    props: ['menuList'],
    data () {
      return {
        count: '0'
      }
    }
  }
</script>
